Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import SearchForm from './modules/SearchForm'; |
||
6 | onmatch: function () { |
||
7 | window.langeditor = { |
||
8 | instances: [], |
||
9 | modules: [ |
||
10 | {name: 'search-form', class: SearchForm} |
||
11 | ] |
||
12 | }; |
||
13 | |||
14 | window.langeditor.modules.forEach((item) => { |
||
15 | // try to find an element |
||
16 | let element = $(this).find(`*[data-module="${item.name}"]`); |
||
17 | |||
18 | if (element.length) { |
||
19 | window.langeditor.instances.push(new item.class(element[0])); |
||
20 | } |
||
21 | }); |
||
22 | } |
||
23 | }); |
||
25 | })(jQuery); |